<!-- eslint-disable vue/no-unused-vars -->
<template>
  <div>
    <!-- 三级联动全局组件,可直接使用 -->
   <TypeNav></TypeNav>
   <listContainer></listContainer>
   <Recommend></Recommend>
   <Rank />
   <Like />
   <Floor v-for="(floor,index) in floorList" :key="floor.id" :list="floor"/>     
   <Brand />
  </div>
</template>

<script>
//引入其他组件
import listContainer from '@/pages/Home/listContainer';
import Recommend from '@/pages/Home/Recommend';
import Rank from '@/pages/Home/Rank';
import Like from '@/pages/Home/Like';
import Floor from '@/pages/Home/Floor';
import Brand from '@/pages/Home/Brand';
import {mapState} from 'vuex';
export default{
    // eslint-disable-next-line vue/multi-word-component-names
    name:"home",
    components:{
      listContainer,
      Recommend,
      Rank,
      Like,
      Floor,
      Brand,
    },
    mounted() {
      //在home派发floor数据,因为floor复用,需要遍历
       this.$store.dispatch('home/getFloorList')
       //派发action,获取用户信息
       this.$store.dispatch('user/getUserInfo');
    },
    computed:{
      ...mapState({
        floorList:state=> state.home.FloorList
      })
    }
}

</script>

<style lang='less' scoped>

</style>
